import request from '../request'
import type {Home} from '@/TS/utlis/interface/Home'
// 获取订单外卖列表
export const takeOutGoods = (data: Home.takeOutGoods, Proxy: any) => {
    return request(
        {
            url: '/rider/systemRiderTakeaway/takeOutGoods',
            method: 'POST',
            data,
            show: false
        },
        Proxy
    )
}
// 获取消息列表
export const infoList = (data: Home.takeOutGoods, Proxy: any) => {
    return request(
        {
            url: '/chatRooms/queryChatRoomsList',
            method: 'GET',
            data,
            show: false
        },
        Proxy
    )
}


// 订单跑腿列表
export const TaskList = (data: Home.takeOutGoods, Proxy: any) => {
    return request(
        {
            url: '/rider/errandController/errandTaskList',
            method: 'POST',
            data,
            show: false
        },
        Proxy
    )
}


// 外卖抢单
export const robOrder = (data: Home.robOrder, Proxy: any) => {
    return request(
        {
            url: '/rider/systemRiderTakeaway/robOrder',
            method: 'POST',
            data,
            show: true
        },
        Proxy
    )
}
// 获取所有订单数量

export const orderCount = (Proxy: any) => {
    return request(
        {
            url: '/rider/systemRiderTakeaway/orderCount',
            method: 'GET',
            show: true
        },
        Proxy
    )
}
// 获取新消息

export const infoCount = (Proxy: any) => {
    return request(
        {
            url: '/chatMessages/queryUseNewMeaage',
            method: 'GET',
            show: true
        },
        Proxy
    )
}


// 查询是否有新的订单并语音提醒
export const queryNewOrdersReuqest = (data: any, Proxy: any) => {
    return request(
        {
            url: '/rider/systemRiderUsers/newOrder',
            method: 'POST',
            data,
            show: false
        }, Proxy)
}
